class Solution:
    def fractionToDecimal(self, numerator: int, denominator: int) -> str:
        ans = []
        flag = True
        while numerator:
            if flag and numerator < denominator:
                ans.append('.')
                flag = False
            numerator //= denominator
            ans.append(numerator)
            denominator *= 10
        return "".join(map(str, ans))

if __name__ == '__main__':
    s = Solution()
    r = s.fractionToDecimal(1,2)
    print(r)